from selenium import webdriver
from time import sleep
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium import webdriver
# 导入 Service 类（关键）
from selenium.webdriver.chrome.service import Service

#实例化对象：

service = Service(executable_path="E:\\python\\python38\\chromedriver.exe")
driver = webdriver.Chrome(service=service)
driver.get("http://121.43.169.97:8848/pageA.html")
action = ActionChains(driver)

driver.maximize_window()

driver.find_element(By.CSS_SELECTOR,"#userA").send_keys("admin")

driver.get_screenshot_as_file("img/admin.png")
sleep(5)